Recording apparatus, recording method, program and storage medium

ABSTRACT

In a recording apparatus, a succeeding chapter of a video stream is recorded by being connected to the preceding chapter of the video stream contained in a multiplexed stream. When transfer of the succeeding chapter of the video signal from a video encoder to a VBV buffer starts, a multiplexer is controlled in such a manner that the fullness of the VBV buffer will exceed a set threshold value.

TECHNICAL FIELD

The present invention relates to a recording apparatus, recordingmethod, program and storage medium for recording video information, suchas a still image or moving picture, and audio information on a recordingmedium.

BACKGROUND ART

Video cameras that employ a disk-shaped recording medium as a storagemedium have started to become commercially available in recent years.Such video cameras are compact and highly portable and it is believedthat they will become increasingly popular forwarding the future. Insuch a device, a multiplexed stream is recorded on the recording mediumat the time of recording. The multiplexed stream is the result ofmultiplexing a video stream, which has been compressed and encoded as bythe MPEG scheme, and an audio stream.

The DVD-Video standard is known as a standard for thus recording videodata and audio data on a recording medium. With the DVD-Video standard,moving picture data is recorded upon being encoded by the MPEG-2 scheme.According to the MPEG-2 standard, a buffer memory referred to as a VBV(Video Buffering Verifier) buffer for accumulating encoded data ishypothesized between an encoder and a decoder in a signal processingcircuit, and encoding is performed in such a manner that the VBV bufferwill not fail.

However, in a case where pictures shot by a video camera are recorded,recording is performed by so-called stop-and-go connective shooting.That is, intermittent recording that involves recording, temporary stop,recording, temporary stop, recording and so on, can be performedfrequently. Imagine a case where video streams of a plurality of scenesencoded and recorded intermittently are connected and recorded in such amanner that there will be no loss of presentation at the time ofplayback. In this case, there is the danger that the VBV buffer willfail because the data of succeeding scene is input to the VBV bufferwithout taking into consideration the amount of the VBV buffer occupiedby a preceding scene.

An example of a VBV buffer in the failed condition is underflow, namelywhen data that is to be decoded has not accumulated in memory at suchtime that the data is to be decoded.

Accordingly, as disclosed in the specification of Japanese PatentLaid-Open No. 2005-136633, there has been proposed a technique in whichthe amount of code of the lead-off picture in a succeeding chapter of asucceeding video stream is adjusted at the time of recording in order toperform recording connectively without VBV buffer failure and in such amanner that playback can be performed without loss of data between itemsof video data of a plurality of scenes.

With the prior-art arrangement disclosed in the specification ofJapanese Patent Laid-Open No. 2005-136633, recording without loss ofdata at the time of playback is possible by controlling the fullness ofthe VBV buffer at the time of recording. However, the amount of codethat can be allocated to the lead-off picture of a succeeding videostream depends upon the amount of the VBV buffer occupied by a precedingvideo stream at the time that playback of the succeeding video streamstarts. Consequently, if a situation arises in which a sufficient amountof code cannot be allocated to the lead-off picture of the succeedingvideo stream at the time of playback, the image quality of playbackvideo may be degraded by loss of data during the course of changeoverfrom the preceding stream to the succeeding stream, and there is thepossibility that the user will find this annoying.

DISCLOSURE OF INVENTION

Accordingly, an object of the present invention is to provide arecording apparatus that is capable of successively recording aplurality of different video streams without degrading the quality of asucceeding video stream at playback.

According to the present invention, the foregoing object is attained byproviding a recording apparatus comprising: a video encoder for encodingvideo data and generating a video stream; an audio encoder for encodingaudio data and generating an audio stream; a multiplexer formultiplexing the video stream and audio stream and generating amultiplexed stream; a recording unit for recording the multiplexedstream on a recording medium; a fullness controller for controlling thevideo encoder based upon amount of a virtual buffer memory occupied bythe multiplexed stream, the virtual memory being used when themultiplexed stream is decoded; and a multiplexing controller forcontrolling multiplexing of the audio stream by the multiplexer onto afirst multiplexed stream in such a manner that the fullness of thevirtual buffer memory at the time of decoding of a lead-off picture ofthe video stream contained in a second multiplexed stream of themultiplexed stream, which is played back following the first multiplexedstream of the multiplexed stream, will exceed a set threshold value.

According to the present invention, the foregoing object is attained byproviding a recording method comprising: a video encoding step ofencoding video data and generating a video stream; an audio encodingstep of encoding audio data and generating an audio stream; amultiplexing step of multiplexing the video stream and audio stream andgenerating a multiplexed stream; a recording step of recording themultiplexed stream on a recording medium; a fullness control step ofcontrolling the video encoder based upon the amount of a virtual buffermemory occupied by the multiplexed stream, the virtual memory being usedwhen the multiplexed stream is decoded; and a multiplexing control stepof controlling multiplexing of the audio stream by the multiplexing steponto a first multiplexed stream in such a manner that the fullness ofthe virtual buffer memory at the time of decoding of a lead-off pictureof the video stream contained in a second multiplexed stream of themultiplexed stream, which is played back following the first multiplexedstream of the multiplexed stream, will exceed a set threshold value.

In accordance with the recording apparatus of the present invention, itis possible to successively record different chapters of a video streamwithout degrading the image quality of a succeeding chapter at playback.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A is a block diagram of a recording apparatus according to anembodiment of the present invention;

FIG. 1B is a block diagram of a recording apparatus according to anembodiment of the present invention;

FIG. 2A is a diagram showing the specific structure of part of therecording apparatus according to this embodiment of the presentinvention;

FIG. 2B is a diagram showing the specific structure of part of therecording apparatus according to this embodiment of the presentinvention;

FIG. 3 is a conceptual view illustrating the transition of amount of aVBV buffer occupied in MPEG-2;

FIG. 4 is a conceptual view illustrating the transition of VBV bufferfullness at the time of connection with loss of data in MPEG-2;

FIG. 5 is a conceptual view illustrating the transition of VBV bufferfullness at the time of connection without loss of data in MPEG-2;

FIG. 6 is a conceptual view illustrating the relationship between audioand video of preceding and succeeding chapters at the time of connectionwithout loss of data in MPEG-2;

FIG. 7 is a conceptual view illustrating an example of transition of VBVbuffer fullness at the time of connection without loss of data, thisdiagram being useful in describing the operation of the recordingapparatus according to this embodiment of the present invention;

FIG. 8 is a conceptual view illustrating an example of transition of VBVbuffer fullness at the time of connection without loss of data, thisdiagram being useful in describing the operation of the recordingapparatus according to this embodiment of the present invention;

FIG. 9 is a flowchart of multiplexing control processing at the time ofconnection without loss of data, this flowchart being useful indescribing the operation of the recording apparatus according to thisembodiment of the present invention; and

FIG. 10 is a conceptual view illustrating the relationship between audioand video of preceding and succeeding chapters at the time of connectionwithout loss of data in a recording apparatus according to thisembodiment of the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

FIG. 1A is a conceptual block diagram of a recording apparatus accordingto a first embodiment of the present invention, and FIG. 1B is aconceptual block diagram of a playback apparatus for playing back arecording medium D that has been recorded on by the recording apparatusof FIG. 1A. Reference will be had to FIGS. 1A and 1B to describe anarrangement in which a video stream is recorded in such a manner thatloss of data will not occur between scenes when video streams of aplurality of scenes are played back successively in the recordingapparatus according to this embodiment of the present invention.

The recording side and the playback side are usually constructed as asingle recording/playback apparatus. Here, however, these areillustrated as being different for the sake of explanation. Accordingly,in the description that follows, FIG. 1A will be described as therecording side and FIG. 1B as the playback side. Since the arrangementis that of a single recording/playback apparatus in which the recordingand playback sides have been incorporated, the circuits on the recordingand playback sides are partially shared and some of the referencecharacters are shared as well in the description.

On the recording side in FIG. 1A, a video input unit 101 supplies inputvideo data to a video encoder 103. An audio input unit 102 suppliesinput audio data to an audio encoder 104. The video encoder 103 encodesthe input video data by a well-known compressive encoding method such asthe MPEG scheme and outputs the encoded data to a multiplexer 106 as avideo stream. The audio encoder 104 encodes the input audio data by awell-known compressing encoding method such as AC3 and outputs theencoded data to the multiplexer 106 as an audio stream.

The multiplexer 106 multiplexes the video stream that has been outputfrom the video encoder 103 and the audio stream that has been outputfrom the audio encoder 104 into the DVD format conforming to therecording medium D and supplies the result to a recording/playback unit107 as a multiplexed stream. The recording/playback unit 107 writes themultiplexed stream from the multiplexer 106 to the recording medium D.In this case, it is assumed that the recording/playback unit 107 isconstituted by a recording unit and a playback unit. Although an opticalpick-up usually is used for recording and playback of a disk-shapedrecording medium, the same optical pick-up is used at the time ofrecording and at the time of playback. The recording unit is connectedto the optical pick-up at the time of recording, and the playback unitis connected at the time of playback.

In the recording apparatus according to this embodiment, a multiplexedstream of a series of scenes recorded on the recording medium (disk) Dbetween a recording-start command and a recording-stop command from theuser is managed as one chapter in the DVD video standard.

In this series of recording process steps, a fullness controller 105monitors the fullness of a VBV buffer in accordance with the MPEG-2standard and controls the video encoder 103 in such a manner that theVBV buffer will not underflow. Further, a multiplexing controller 108controls the fullness controller 105 and multiplexer 106. The detailswill be described later. It should be noted that fullness of the VBVbuffer means the amount of code present within the VBV buffer.Furthermore, the VBV buffer is a virtual buffer memory and is providedconceptually in association with the video encoder 103 and multiplexer106. In actuality, therefore, the VBV buffer is not necessarily providedin association with the video encoder 103 and multiplexer 106 and doesnot necessarily exist physically.

Further, on the playback side in FIG. 1B, it is assumed that therecording/playback unit 107 uses the same circuit block as that on therecording side in FIG. 1A and therefore the same reference charactersare used. Further, a demultiplexer 109 demultiplexes a multiplexedstream, which has been reproduced from the recording medium D by therecording/playback unit 107, into a video stream and audio stream. Thedemultiplexed video stream is supplied to a video decoder 110 and thedemultiplexed audio stream is supplied to an audio decoder 111.

The video decoder 110 decodes the video stream reproduced from therecording medium D. A video output unit 113 outputs the video stream,which has been decoded by the video decoder 110, to an external monitoror the like as video data. The audio decoder 111 decodes the audiostream reproduced from the recording medium D. An audio output unit 112outputs the audio stream, which has been decoded by the audio decoder111, to a speaker, etc., of the external monitor as audio data.

More specifically, as illustrated in FIG. 2A, it is assumed that thevideo encoder 103 on the recording side is composed of an encodingcircuit 201 and VBV buffer 202. Further, as illustrated in FIG. 2B, itis assumed that the video decoder 110 is composed of a decoding circuit203 and VBV buffer 202. Since it is assumed that the recording andplayback sides have been integrated, it is assumed that the VBV buffer202 is shared and therefore is represented by the same referencecharacters. However, the VBV buffer 202 is strictly virtual. Inactuality, therefore, the buffer memory illustrated as being connecteddoes not necessarily exist.

If the VBV buffer 202 on the recording side is viewed from the side ofthe encoding circuit 201, the VBV buffer 202 is connected to the outputside of the encoding circuit 201, as illustrated in FIG. 2A. In thiscase, the transfer of stream data from the encoding circuit 201 to theVBV buffer 202 is theoretically executed instantaneously. The transferof stream data from the VBV buffer 202 to the multiplexer 106 isexecuted at a transfer rate “Rmax” in a case where the stream dataexists in the VBV buffer 202. However, if the stream data does not existin the VBV buffer 202, then it is assumed that the transfer rate is “0”.

In this case the fullness of the VBV buffer 202 is ascertained and theoperation of the video encoder 103 is controlled by the fullnesscontroller 105 in such a manner that buffer fullness will not exceed themaximum buffer capacity of the VBV buffer 202 (i.e., in such a mannerthat overflow will not occur).

On the other hand, if the VBV buffer 202 on the playback side is viewedfrom the side of the decoding circuit 203, the VBV buffer 202 isconnected to the input side of the decoding circuit 203, as illustratedin FIG. 2B. In this case, the transfer of stream data from the VBVbuffer 202 to the decoding circuit 203 is theoretically executedinstantaneously. The transfer of stream data from the demultiplexer 109,which demultiplexes the multiplexed stream read out of therecording/playback unit 107, to the VBV buffer 202 is executed at thetransfer rate “Rmax” or transfer rate “0”.

In this case the stream data must be transferred in such a manner thatthe maximum buffer capacity of the VBV buffer 202 is not exceeded, andthe stream data must be transferred to the decoding circuit 203 so as tobe in time for decoding in the decoding circuit 203. If the transfer ofthis stream data is not in time for decoding in the decoding circuit203, underflow will occur in the VBV buffer 202 and signal dropout willoccur.

FIG. 3 is a diagram illustrating the transition of fullness of VBVbuffer 202 as seen from the side of the decoding circuit 203 on theplayback side. A method of updating fullness of the decoding circuit 203will be described with reference to FIG. 3, in which the vertical axisrepresents the fullness of the VBV buffer 202 and the horizontal axisindicates time. Buffer fullness represented along the vertical axis isindicated as an increasing value. This means that the higher the valuealong the vertical axis, the greater the fullness of the VBV buffer 202.Further, the overall buffer capacity of the VBV buffer 202 is assumed tobe 230 KB, by way of example.

At playback, the video stream contained in the multiplexed stream istransferred to the VBV buffer 202 through the recording/playback unit107 and demultiplexer 109 at the transfer rate “Rmax”. When the timingfor decoding a picture “I2” arrives in FIG. 3, a video stream of codeamount “size I2” is transferred from the VBV buffer 202 to the decodingcircuit 203 from a position P-I2 of buffer fullness instantaneously atthis timing. Then, in similar fashion, a video stream is transferred tothe VBV buffer 202 through the recording/playback unit 107 anddemultiplexer 109 at the transfer rate “Rmax” up to the timing fordecoding a picture “B0”. In FIG. 3, time T represents a picture displayperiod and is the reciprocal of the frame rate.

Further, in a case where a video stream overflows from the VBV buffer202, at timing t1 in FIG. 3, the transfer of the video stream from thedemultiplexer 109 is stopped. Thus, the fullness of VBV buffer 202 asseen from the side of the decoding circuit 203 is controlled at the timeof playback.

At the time of recording, on the other hand, the fullness controller 105controls the fullness of the VBV buffer 202, exercises control in such amanner that the VBV buffer 202 will not underflow and controls theencoding circuit 201 so as to encode an uninterrupted video stream.

FIG. 4 is a diagram illustrating an example of the transition offullness of VBV buffer 202 as seen from the side of the decoding circuit203 in a case where a multiplexed stream of two chapters is played backcontinuously. The vertical axis represents the fullness of the VBVbuffer 202 and the horizontal axis indicates time. The fullness of thebuffer represented along the vertical axis is indicated as an increasingvalue. This means that the higher the value along the vertical axis, thegreater the fullness of the VBV buffer 202.

In a case where a video stream exists in the multiplexed stream,transfer and storage of the video stream to the VBV buffer 202 arecarried out at the transfer rate “Rmax”. If a video stream does notexist in the base station, however, no transfer and storage of a videostream takes place. Further, transfer of a video stream from the VBVbuffer 202 to the decoding circuit 203 is performed instantaneously atthe timing at which the decoding of each picture starts.

It should be noted that although the VBV buffer 202 has enough buffercapacity to store several frames of a video stream, an audio buffer (notshown) for storing the audio stream has a small buffer capacity. Afterall video streams are multiplexed, therefore, padding data for adjustingthe stream size in accordance with the audio stream or units of anerror-correction code (ECC) is multiplexed, as shown in FIG. 4.

In the case of FIG. 4, the decoded image at the time of playbackdevelops a break between a chapter played back previously and a chapterplayed back subsequently. In this case, the video stream of thesucceeding chapter is read out of the recording medium (disk) D andtransferred to the VBV buffer 202 after the amount of the VBV buffer 202occupied by the video stream of the preceding chapter becomes zero. As aresult, it is no longer necessary to take into account the fullness ofthe VBV buffer 202 when playback of the succeeding chapter starts.

FIG. 5 illustrates a case where video streams of preceding andsucceeding chapters have been played back in such a manner that there isno loss of video data at the portion where the changeover occurs. Inthis case it is necessary to prevent loss of audio as well in a mannersimilar to that of video, as illustrated in FIG. 6. However, since theduration of a frame in a video stream differs from that in an audiostream, there are occasions where the lengths of video and audio of apreceding chapter in the portion immediately preceding changeover aredifferent.

In order to perform playback in such a manner that there will be no lossat the portion where there is a changeover between different chapters,as illustrated in FIG. 5, it is necessary to start transferring thevideo stream of the succeeding chapter to the VBV buffer 202 before theamount occupied by the video stream of the preceding chapter in the VBVbuffer 202 becomes zero. Therefore, when the amount of code to beallocated to the chapter at the beginning portion of the video stream ofthe succeeding chapter is decided, it is necessary to take intoconsideration the amount of the buffer occupied by the video stream ofthe preceding chapter that has accumulated in the VBV buffer 202 at thestart of playback of the video stream of the succeeding chapter.

If it is attempted to transfer a video stream from the VBV buffer 202 tothe decoding circuit at the time of playback at a stage where asufficient amount of the video stream has not accumulated in the VBVbuffer 202, there is the danger that underflow will occur in the VBVbuffer 202. In FIG. 5, for example, imagine a case where a video streamnecessary in order to decode the leading picture “I2” in a succeedingchapter is transferred instantaneously. In this case, if a sufficientamount of data of the video stream has not accumulated in the VBV buffer202, then the data necessary for decoding will not be obtained and, as aresult, playback without loss will not be possible.

Accordingly, in order to accumulate a sufficient amount of data of thevideo stream in the VBV buffer 202 in advance, it is necessary to start,at a timing as early as possible, the transfer and storage of data ofthe video stream of the succeeding chapter to the VBV buffer. However,there is a limitation upon this timing because read-out of the videostream of the succeeding chapter must be started after the end ofread-out of the video stream of the preceding chapter from the disk D.

Accordingly, in the recording apparatus according to this embodiment ofthe present invention, the timing of start of read-out of the data of asucceeding video stream from the disk is adjusted to occur earlier byadjusting the timing of end of multiplexing of an audio stream of thepreceding chapter at the time of recording. As a result, it is soarranged that a sufficient amount of stream data accumulates in the VBVbuffer 202 at the time of decoding of the preceding chapter in the dataof the succeeding video stream.

To accomplish this, the multiplexing controller 108 controls thecondition for ending the generation of the multiplexed stream of thepreceding chapter in the multiplexer 106. As mentioned earlier, theaudio buffer that stores the audio stream has a small buffer capacity.Accordingly, for the convenience of generating the multiplexed stream,additional data for making chapter size conform to the audio stream orunit of ECC is multiplexed following the multiplexing of all videostreams.

In a case where a multiplexed stream of two chapters is played backcontinuously, the multiplexing controller 108 controls the multiplexer106 in such a manner that the fullness of the VBV buffer at the time ofdecoding of the leading picture “I2” of the succeeding chapter exceeds aset threshold value “VBV_th”. That is, in the recording apparatusaccording to the first embodiment, the threshold value “VBV_th” is setdepending upon the amount of code to be allocated to the leading picture“I2” of the succeeding chapter. In other words, in a case where it isdesired that the leading picture of the succeeding chapter be encoded toa high image quality, the threshold value “VBV_th” should be set higher.The higher the threshold value is set, the greater the amount of codethat can be allocated to the leading picture.

FIG. 7 is a conceptual view illustrating how data accumulates in thebuffer memory in a case where a multiplexed stream of two chapters isplayed back continuously. Reference will be had to FIG. 7 to describe acondition for which the amount of the VBV buffer 202 occupied at thestart of decoding of the leading picture “I2” in the succeeding chapterwill exceed the set threshold value “VBV_th”.

In the recording apparatus according to this embodiment, an encodedvideo stream and encoded audio stream are divided into a plurality ofpackets every predetermined amount of data, and multiplexing isperformed on a per-packet basis.

Let “pre_SCR_END” represent the timing at which the final data of apreceding chapter is transferred to the VBV buffer, and let “DTS(I2)”represent the timing of decoding of the leading picture “I2” in thesucceeding chapter. Furthermore, let “SCR_LIMIT” represent the timing atwhich the transfer of the video stream of the succeeding chapter to theVBV buffer 202 must be started in such a manner that the amount of thebuffer occupied by the multiplexed stream that has accumulated in theVBV buffer at the decoding timing “DTS(I2)” will exceed the setthreshold value “VBV_th”. In this case, the transfer-start timing“SCR_LIMIT” is represented by the following equation:“SCR_LIMIT”=“DTS(I2)”−“VBV _(—) th”/“rmax”

Since the threshold value “VBV_th” is exceeded, it is required that thetransfer timing “pre_SCR_END” of the final data in the preceding chapterbe earlier than transfer-start timing “SCR_LIMIT”. To accomplish this,it is required that generation of the multiplexed stream of thepreceding chapter be concluded in such a manner that “pre_SCR_END” willnot exceed “SCR_LIMIT”. If this is expressed by an equation, it will berequired that the following relationship hold:“pre_SCR_END”<“SCR_LIMIT”

Imagine a case where generation of the multiplexed stream of thepreceding chapter cannot be concluded in such a manner that thetransfer-arrival timing “pre_SCR_END” of the final data of the precedingchapter will not exceed the transfer-start timing “SCR_LIMIT” of thesucceeding chapter. In this case, the fullness of the VBV buffer 202will not exceed the threshold value “VBV_th” at the decoding timing“DTS(I2)”, as illustrated in FIG. 8.

Accordingly, in the recording apparatus according to this embodiment ofthe present invention, when halting of recording of the precedingchapter has been specified, the multiplexing controller 108 adjusts themultiplexed amount of the audio stream after all video streams have beenmultiplexed. At the moment of decoding timing “DRS(I2)”, the multiplexer106 is controlled in such a manner that the amount of the VBV buffer 202occupied will exceed the set threshold value “VBV_th”.

FIG. 9 is a flowchart illustrating control of the multiplexer 106 by themultiplexing controller 108 when recording of a multiplexed stream ishalted. Reference will be had to FIG. 9 to describe a control methodwhereby the multiplexing controller 108 exercises control in such amanner that the amount of the VBV buffer 202 occupied at decoding of theleading picture “I2” in the succeeding chapter will exceed the setthreshold value “VBV_th”.

If a command to halt recording is issued from a operation input unit(not shown), the processing in the flowchart of FIG. 9 starts. First, atstep S401, a frame in which recording conforming to the recording-haltcommand is halted is decided and the multiplexing controller 108instructs the multiplexer 106 to execute ordinary multiplexingprocessing. At step S402, the multiplexing controller 108 determineswhether all video streams of preceding chapters inclusive of therecording-halt frame have been made a multiplexed stream. Controlproceeds to step S403 if all of these streams have been made amultiplexed stream. However, if there is a video stream that has notbeen made a multiplexed stream, control returns to step S401 and themultiplexer 106 is instructed to execute the usual processing of amultiplexed stream.

At step S403, the multiplexing controller 108 compares the decodingtiming (time) of an audio stream that is to be made a multiplexed streamfrom this point onward and the decoding timing (time) of a video streamthat has already been made a multiplexed stream. If the decoding timing(time) of the audio stream is greater than the decoding timing (time) ofthe video stream that has already been made a multiplexed stream, thencontrol proceeds to step S406.

However, if the decoding timing (time) of the audio stream is equal toor less than the decoding timing (time) of the video stream that hasalready been made a multiplexed stream, then control branches to stepS404.

In this embodiment, when a video stream and an audio stream aremultiplexed, multiplexing is performed in packet units, where the packetis defined according to the MPEG scheme. Specifically, the video andaudio streams are each divided into packets comprising a prescribedamount of data, and the video data (video packet) and audio data (audiopacket) are multiplexed in units of these packets.

At step S404, assume a case where one further packet of an audio streamhas been multiplexed onto a video stream. The multiplexing controller108 determines whether a timing “PCRlast” at which the final packet ofthe preceding chapter is transferred to the VBV buffer is greater than atransfer timing “PCR_limit” prevailing in a case where the fullness ofthe VBV buffer 202 exceeds the set threshold value at the decodingtiming of the succeeding leading picture “I2”.

In this case, assume that the arrival timing of the final packet of thepreceding chapter is smaller than transfer-start timing prevailing in acase where the amount of the buffer occupied by video data that hasaccumulated in the VBV buffer 202 exceeds the set threshold value at thedecoding timing of the leading picture “I2” in the succeeding chapter.In this case, control branches to step S405. Otherwise, control proceedsto step S406.

At step S405, “PCRlast” does not exceed the transfer-start timing“SCR_LIMIT” even if one further packet of the audio stream ismultiplexed onto the multiplexed stream. In this case, therefore, themultiplexing controller 108 multiplexes just one packet of the audiostream onto the already multiplexed stream and returns control to stepS403. The multiplexing controller 108 executes the processing of stepS403 again.

The multiplexing controller 108 specifies processing for endingmultiplexing at step S406. In a case where the audio stream has not beenmultiplexed in frame units, the processing for ending multiplexing makesthe remaining frames a multiplexed stream in such a manner that an audiostream that has been made a multiplexed stream becomes the frame unit.In a case where the size of the stream of a preceding chapter is not theECC unit, a packet of additional data is made the multiplexed stream,processing is executed in such a manner that the size of the precedingmultiplexed stream becomes the ECC unit, and multiplexing processing isconcluded. Next, at step S407, the fullness of the VBV buffer 202 at thetime of decoding of the leading picture “I2” in the succeeding chapteris computed, the result is reported to the fullness controller 105 andprocessing is terminated. The above-described operation is executed bycontrolling the multiplexer 106 using the multiplexing controller 108.

By executing the processing set forth above, it is possible record adifferent chapter of a video stream successively without degrading theimage quality of a succeeding chapter at the time of playback even ifrecording is resumed the next time.

It should be noted that with regard to the processing shown in FIG. 9,the roles of the multiplexing controller 108 and fullness controller 105can be performed by a CPU (not shown), and the above-described controlcan be implemented in accordance with a program that has been stored ina ROM, etc., connected to the CPU.

FIG. 10 is a conceptual view illustrating the relationship between audioand video of preceding and succeeding chapters in the recordingapparatus according to this embodiment of the present invention.Reference will be had to FIG. 10 to describe the relationship betweenaudio and video of preceding and succeeding chapters multiplexed underthe control of the multiplexing controller 108.

There are instances where the multiplexing controller 108 multiplexesless of the audio stream of a preceding chapter onto a video stream insuch a manner that the amount of the buffer occupied by the video streamaccumulated in the VBV buffer will exceed the set threshold value“VBV_th” at the decoding timing of the leading picture “I2” in thesucceeding chapter. In this case, the succeeding chapters aremultiplexed from a timing that is earlier for the audio stream than forthe video stream, and the video and audio are connected without dropout.

By thus performing operation, if a user has recorded a plurality ofchapters, a state will be attained in which the amount of the VBV buffer202 occupied exceeds the set threshold value “VBV_th” at the decodingtiming of the leading picture “I2” in the succeeding chapter.Accordingly, a sufficient amount of stream code can be allocated to thesucceeding chapter in comparison with the conventional arrangement inwhich there is the possibility that the amount of the VBV buffer 202occupied will be too small. Further, although the timing of changeoverbetween video and audio at the location of the connection between apreceding chapter and succeeding chapter shifts, the user will not beannoyed significantly because the video and audio do not change oversimultaneously from the outset.

In accordance with the present invention, a succeeding chapter can berecorded so as to be reproducible at a stable image quality without adecline in the image quality of the succeeding chapter at the time ofplayback.

<Other Embodiments>

In the recording apparatus according to the embodiment described above,control is carried out by the multiplexing controller 108 in such amanner that the amount of the VBV buffer 202 occupied will accumulate upto the set threshold value “VBV_th” at the decoding timing of theleading picture in the succeeding chapter. However, an arrangement inwhich control is exercised by the multiplexing controller 108 in such amanner that the amount of the VBV buffer 202 occupied will accumulate tothe full buffer capacity of the VBV buffer 202 also falls within thescope of the present invention.

Furthermore, it is possible for the recording apparatus according to theembodiment of the present invention to be constructed as a digital videocamera. Further, the recording medium D used in recording may bemagnetic tape or a solid-state memory device such as a semiconductormemory as a matter of course.

Further, it is possible for the recording apparatus according to theembodiment of the present invention to be constructed as arecording/playback apparatus. Furthermore, it is possible for therecording apparatus according to the embodiment of the present inventionto be applied as an editing apparatus having a simple editing function.

The present invention may be applied to a system constituted by aplurality of devices (e.g., a host computer, camera, interface, liquidcrystal panel, etc.) or to an apparatus comprising a single device(e.g., a copier or facsimile machine, etc.).

Further, the present invention can be implemented by supplying a systemor apparatus with a storage medium storing the program codes of thesoftware for performing the function of the foregoing embodiment. Thatis, the object of the present invention is also attained by reading outand executing program codes, which have been stored on a storage medium,by a computer (CPU or MPU) of the system or apparatus. In this case, theprogram codes per se read from the storage medium implement thefunctions of the embodiment, and the storage medium storing the programcodes constitutes the invention. Examples of storage media that can beused for supplying the program code are a flexible disk, hard disk,optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape,non-volatile type memory card or ROM, etc.

Further, besides the case where the aforesaid functions according to theembodiment are implemented by executing the program codes read by acomputer, an operating system or the like running on the computer canexecute some or all of the actual processing based upon the commands ofthe program codes. Thus the present invention also covers a case wherethe functions of the foregoing embodiment are implemented by thisprocessing.

Furthermore, program code that has been read from a storage medium canbe executed upon being written to a memory provided on a functionexpansion board inserted into a computer or provided in a functionexpansion unit connected to the computer. Accordingly, a CPU or the likeprovided on the function expansion board or function expansion unitperforms some or all of the actual processing based upon the commands ofthe program code and the functions of the foregoing embodiment areimplemented by this processing.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of

Japanese Patent Application No. 2007-009585, filed on Jan. 18, 2007,which is hereby incorporated by reference herein in its entirety.

1. A recording apparatus comprising: a video encoder that encodes videodata and generates a video stream; an audio encoder that encodes audiodata and generates an audio stream; a multiplexer that multiplexes thevideo stream and the audio stream and generates a multiplexed stream; arecording unit that records the multiplexed stream on a recordingmedium, the recording unit recording a first multiplexed stream on therecording medium in accordance with an instruction from a user to startrecording the first multiplexed stream, and recording a secondmultiplexed stream on the recording medium in accordance with aninstruction from a user to start recording the second multiplexedstream, the second multiplexed stream being played back following thefirst multiplexed stream; a fullness controller that controls said videoencoder based upon a fullness of a virtual buffer memory with themultiplexed stream, the virtual memory being used when the multiplexedstream is decoded; and a multiplexing controller that controls saidmultiplexer in accordance with an instruction from the user to stoprecording the first multiplexed stream to stop multiplexing the audiostream onto the first multiplexed stream, wherein said multiplexingcontroller sets a threshold value based upon an amount of code allocatedfor a lead-off picture of the video stream contained in the secondmultiplexed stream, and controls a timing at which the multiplexing ofthe audio stream by said multiplexer onto the first multiplexed streamends in such a manner that the fullness of the virtual buffer memory atthe time of decoding of the lead-off picture of the video streamcontained in the second multiplexed stream will exceed the set thresholdvalue.
 2. The apparatus according to claim 1, wherein said multiplexingcontroller controls said multiplexer in such a manner that starting ofplayback of the second multiplexed stream occurs earlier than timing forstart of playback necessary in order that the fullness of the virtualbuffer memory at the time of decoding of a lead-off picture of the videostream contained in the second multiplexed stream will exceed the setthreshold value.
 3. The apparatus according to claim 1, wherein saidmultiplexing controller sets the threshold value based upon the amountof code allocated for the lead-off picture, decoding timing of thelead-off picture of the video stream contained in the second multiplexedstream, and speed of playback at the time of playback of the multiplexedstream.
 4. A recording method comprising: a video encoding step ofencoding video data and generating a video stream; an audio encodingstep of encoding audio data and generating an audio stream; amultiplexing step of multiplexing the video stream and audio stream andgenerating a multiplexed stream; a recording step of recording themultiplexed stream on a recording medium, the recording step recording afirst multiplexed stream on the recording medium in accordance with aninstruction from a user to start recording the first multiplexed stream,and recording a second multiplexed stream on the recording medium inaccordance with an instruction from a user to start recording the secondmultiplexed stream, the second multiplexed stream being played backfollowing the first multiplexed stream; a fullness control step ofcontrolling the video encoder based upon a fullness of a virtual buffermemory with the multiplexed stream, the virtual memory being used whenthe multiplexed stream is decoded; and a multiplexing control step ofcontrolling the multiplexing step in accordance with an instruction fromthe user to stop recording the first multiplexed stream to stopmultiplexing the audio stream onto the first multiplexed stream, whereinthe multiplexing control step sets a threshold value based upon anamount of code allocated for a lead-off picture of the video streamcontained in the second multiplexed stream, and controls a timing atwhich the multiplexing of the audio stream by the multiplexing step ontothe first multiplexed stream ends in such a manner that the fullness ofthe virtual buffer memory at the time of decoding of the lead-offpicture of the video stream contained in the second multiplexed streamwill exceed the set threshold value.